import { combineReducers } from 'redux'
import { connectRouter } from 'connected-react-router'
import global from './global'
import validForm from './validForm'
import dataset from './dataset'
import users from './users'
import project from './project'
import projectConfig from './projectConfig'
import listTable from './listTable'
import tableForm from './tableForm'
import auth0 from './auth0'
import modal from './confirmModal'

const createRootReducer = history => combineReducers({
  router: connectRouter(history),
  [global.store]: global.reducer,
  [validForm.store]: validForm.reducer,
  [dataset.store]: dataset.reducer,
  [users.store]: users.reducer,
  [project.store]: project.reducer,
  [projectConfig.store]: projectConfig.reducer,
  [listTable.store]: listTable.reducer,
  [tableForm.store]: tableForm.reducer,
  [auth0.store]: auth0.reducer,
  [modal.store]: modal.reducer,
})

export {
  global,
  validForm,
  dataset,
  users,
  project,
  projectConfig,
  createRootReducer,
  listTable,
  tableForm,
  auth0,
  modal,
}
